"use strict";

var _regenerator = require("babel-runtime/regenerator");

var _regenerator2 = _interopRequireDefault(_regenerator);

var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require("babel-runtime/helpers/createClass");

var _createClass3 = _interopRequireDefault(_createClass2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _marked = /*#__PURE__*/_regeneratorRuntime.mark(generator);

var creatEle = function creatEle(p1) {
    var ele = new DivElement(p1);
    return ele.getEle();
};

var DivElement = function () {
    (0, _createClass3.default)(DivElement, [{
        key: "genDiv",
        value: function genDiv() {
            var ele = document.createElement("div");
            this.ele = ele;
        }
    }]);

    function DivElement(content) {
        (0, _classCallCheck3.default)(this, DivElement);

        this.genDiv();
        this.ele.innerText = content;
    }

    (0, _createClass3.default)(DivElement, [{
        key: "getEle",
        value: function getEle() {
            return this.ele;
        }
    }]);
    return DivElement;
}();

function generator() {
    return _regenerator2.default.wrap(function generator$(_context) {
        while (1) {
            switch (_context.prev = _context.next) {
                case 0:
                    _context.next = 2;
                    return creatEle("ele1");

                case 2:
                    _context.next = 4;
                    return creatEle("ele2");

                case 4:
                    _context.next = 6;
                    return creatEle("ele4");

                case 6:
                case "end":
                    return _context.stop();
            }
        }
    }, _marked, this);
}

var gen = generator();

document.body.appendChild(gen.next().value);
document.body.appendChild(gen.next().value);
document.body.appendChild(gen.next().value);